﻿using AntBot.Algorithms;

namespace AntBot
{
	public static class Config
	{
		public const HeuristicFormula A_STAR_HEURISTIC = HeuristicFormula.DiagonalShortCut;
		public const bool A_STAR_DIAGONALS = false;
		public const bool A_STAR_HEAVY_DIAGONALS = false;
		public const int A_STAR_HEURISTIC_ESTIMATE = 10;
		public const bool A_STAR_PUNISH_CHANGE_DIRECTION = false;
		public const bool A_STAR_TIE_BREAKER = true;
		public const bool A_STAR_DEBUG_PROGRESS = false;

		//Position evaluation
		public const int FOOD_COLLECTOR_EVAL_FOOD_COUNT_KOEF = 100;
		public const int FOOD_COLLECTOR_EVAL_STEPS_COUNT_KOEF = 10;
		public const int FOOD_COLLECTOR_EVAL_FAREST_FOOD_KOEF = 1;

		//how many ant to find near each food.
		public const int FOOD_COLLECTOR_ANTS_TO_FIND = 3;

		//when expanding node don't do more children
		//(as children are sorted, first ones will be better)
		public const int FOOD_COLLECTOR_MAX_BRANCH_FACTOR = 255;

		static public void SetDefault()
		{
			GameSettings = new Settings
			{
				LoadTime = 100000,
				TurnTime = 100000,
				Rows = 100,
				Cols = 100,
				Turns = 500,
				ViewRadius2 = 93,
				AttackRadius2 = 6,
				SpawnRadius2 = 6
			};

			FoodCollectorSearchRadius2 = GameSettings.ViewRadius2 * 2;
			FoodCollectorMaxTime = 0.5;
			FoodCollectorMaxExpandNodes = 0;
			FoodCollectorTurnsForCollisionCheck = 3;
			FoodCollectorUseSimplePathFinding = true;

			HashTableSizeMb = 16;
		}

		static Config()
		{
			//Init values for changeable parameters
			//FoodCollectorMaxDepth = 10;

			SetDefault();
		}

		public static int FoodCollectorSearchRadius2 { get; set; }
		//How many turns to check for ant collisions
		public static int FoodCollectorTurnsForCollisionCheck { get; set; }
		public static double FoodCollectorMaxTime { get; set; } //in seconds
		public static int FoodCollectorMaxExpandNodes { get; set; }
		//use simple path finding (no water)
		public static bool FoodCollectorUseSimplePathFinding { get; set; }
		public static Settings GameSettings { get; set; }
		public static uint HashTableSizeMb { get; set; }
	}
}